/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package app.web;

import java.util.List;

/**
 * Clase para las utilidades de la aplicacion
 * @author Johann Pando.
 */
public final class Utils {
    
    public static final String SI = "SI";
    
    /**
     * Por cada cadena de la lista se añade una coma.
     *
     * @param listaCadena
     * @return
     */
    public static String cadenaSeparadaComa(List<String> listaCadena) {
        StringBuilder cadenaFinal = new StringBuilder();
        if (listaCadena != null) {
            for (String autor : listaCadena) {
                cadenaFinal = cadenaFinal.append(autor).append(",");
            }
            cadenaFinal = cadenaFinal.delete(cadenaFinal.length() - 1, cadenaFinal.length());
        }
        return cadenaFinal.toString();
    }
}
